package com.isay.app.honey.ui.main;

import android.content.Context;
import android.content.res.Resources;
import android.support.v4.app.Fragment;

import com.isay.app.honey.R;
import com.isay.app.honey.ui.cloud.CloudFragment;
import com.isay.app.honey.ui.direct.DirectFragment;
import com.isay.app.honey.ui.home.HomeFragment;
import com.isay.app.honey.ui.mine.MineFragment;
import com.isay.frameworklib.widget.tab.AppTabInfo;

import java.util.ArrayList;

/**
 * Created by cywu4 on 2018/8/9.
 */

public class MainUtils {


    /**
     * 获取MainActivity展示的fragment
     */
    public static ArrayList<Fragment> getMainTabFragment() {
        ArrayList<Fragment> list = new ArrayList<>();
        list.add(HomeFragment.getInstance());
        list.add(DirectFragment.getInstance());
        list.add(CloudFragment.getInstance());
        list.add(MineFragment.getInstance());
        return list;
    }


    /**
     * 获取MainActivity展示的底部tab
     */
    public static ArrayList<AppTabInfo> getMainTabInfo(Context context) {
        ArrayList<AppTabInfo> tabs = new ArrayList<>();
        Resources r = context.getResources();
        //首页
        AppTabInfo home = new AppTabInfo();
        home.setTabTag("home");
        home.setTabName("首页");
        home.setSelectedDrawable(r.getDrawable(R.drawable.ic_home_p));
        home.setNorDrawable(r.getDrawable(R.drawable.ic_home));
        tabs.add(home);
        //直播
        AppTabInfo direct = new AppTabInfo();
        direct.setTabTag("home");
        direct.setTabName("直播");
        direct.setSelectedDrawable(r.getDrawable(R.drawable.ic_direct_p));
        direct.setNorDrawable(r.getDrawable(R.drawable.ic_direct));
        tabs.add(direct);
        //云播
        AppTabInfo cloud = new AppTabInfo();
        cloud.setTabTag("cloud");
        cloud.setTabName("云播");
        cloud.setSelectedDrawable(r.getDrawable(R.drawable.ic_cloud_p));
        cloud.setNorDrawable(r.getDrawable(R.drawable.ic_cloud));
        tabs.add(cloud);
        //我的
        AppTabInfo beauty = new AppTabInfo();
        beauty.setTabTag("mine");
        beauty.setTabName("我的");
        beauty.setSelectedDrawable(r.getDrawable(R.drawable.ic_me_p));
        beauty.setNorDrawable(r.getDrawable(R.drawable.ic_me));
        tabs.add(beauty);
        return tabs;
    }


}
